//
//  DNDzgzAppDelegate.m
//  DNDzgz
//
//  Created by gimenete on 27/04/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "DNDzgzAppDelegate.h"
#import "RootViewController.h"
#import <CoreLocation/CoreLocation.h>

@implementation DNDzgzAppDelegate

@synthesize window;
@synthesize navigationController;
@synthesize preLodadedBus, preLodadedBizi, preLodadedWifi, service, myPosition;

#pragma mark -
#pragma mark Application lifecycle

- (void)applicationDidFinishLaunching:(UIApplication *)application {    
    
    // Override point for customization after app launch
	preLodadedBus = @"YES";
	preLodadedBizi = @"YES";
	preLodadedWifi = @"YES";
	
	[window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
	[window setBackgroundColor:[UIColor blackColor]];
	
	CLLocationManager *manager = [[CLLocationManager alloc] init];
    if (manager.locationServicesEnabled == NO)
	{
        UIAlertView *servicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services deshabilitado"
																		message:@"Los servicios de localización estan deshabilitados.\nSi continúa se le preguntará si desea activar los servicios de localización cuando sea necesario."
																	   delegate:nil 
															  cancelButtonTitle:@"OK"
															  otherButtonTitles:nil];
        [servicesDisabledAlert show];
        [servicesDisabledAlert release];
    }
    [manager release];     
}


- (void)applicationWillTerminate:(UIApplication *)application {
	// Save data if appropriate
}

#pragma mark -
#pragma mark Memory management

- (void)dealloc {
	[navigationController release];
	[window release];
	[super dealloc];
}

@end